// 新增、编辑文章
export const addOrUpdateApi = async (data) => {
	const {
		data: res
	} = await uni.$http.post(`/api/article/addOrUpdate`, data)
	return res
}
// 增加观看量
export const addViewByIdApi = async (id) => {
	const {
		data: res
	} = await uni.$http.get(`/api/article/addViewById/${id}`)
	return res
}
// 删除文章
export const deleteByIdApi = async (id) => {
	const {
		data: res
	} = await uni.$http.delete(`/api/article/deleteById/${id}`)
	return res
}
// 分页查文章
export const queryListByPageApi = async (data) => {
	const {
		data: res
	} = await uni.$http.post(`/api/article/queryListByPage`, data)
	return res
}
// 分类列表
export const queryCategoryListApi = async () => {
	const {
		data: res
	} = await uni.$http.post(`/api/materialCategory/queryListByPage?pageNum=1&pageSize=9999&type=3`)
	return res
}

// 文章评论
export const addCommentApi = async (data) => {
	const {
		data: res
	} = await uni.$http.post(`/api/add`, data)
	return res
}
// 根据文章差评论
export const findByArticleIdApi = async (articleId) => {
	const {
		data: res
	} = await uni.$http.post(`/api/findByArticleId/${articleId}`)
	return res
}
